package com.bw.common.mvvm.viewmodel;

import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleObserver;
import androidx.lifecycle.OnLifecycleEvent;

/**
 * 当前类关联LifecycleObserver->从而实现关联Activity生命周期
 * */
public interface IViewModel extends LifecycleObserver {

    @OnLifecycleEvent(value = Lifecycle.Event.ON_CREATE)
    void onCreate();

    @OnLifecycleEvent(value = Lifecycle.Event.ON_DESTROY)
    void onDestroy();

}
